using System.Linq;
using System.Text;
using System;
using System.Collections.Generic;
using AmazeUI;
using AmazeUI.Imodel;
namespace AmazeUI.db
{
    public partial class XtRole
    {

        public XtRole(IXtRole model)
            : this()
        {
            SetModel(model);
            this.AddTime = DateTime.Now; 
        }
        public void SetModel(IXtRole model)
        { 
            this.Name = model.Name;
            this.Details = model.Details;
            this.Powers = string.Join("|", model.Powers.Where(a => !string.IsNullOrWhiteSpace(a)));
            
        }

    }
}
